package com.xinruke.hostels.reservation.controller.pms;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.common.vo.query.RowsDataVO;
import com.xinruke.hostels.reservation.interfaces.dto.MeetingInqueryListQueryDto;
import com.xinruke.hostels.reservation.interfaces.dto.MeetingInqueryListQueryResultDto;
import com.xinruke.hostels.reservation.interfaces.dto.MeetingInquerySubmitInfoDto;
import com.xinruke.hostels.reservation.interfaces.dto.pms.*;
import com.xinruke.hostels.reservation.service.MeetingService;
import com.xinruke.hostels.reservation.service.pms.MeetingBookingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author Chenry
 * @ClassName MeetingBookingController
 * @date：2019/7/19
 * @version: V1.0.0
 * @description：会议预订管理
 */
@RestController
@RequestMapping("/meeting/booking")
@Api(tags = "pms会议预订单管理")
public class MeetingBookingController extends BaseController {

    @Resource
    private MeetingBookingService meetingBookingService;

    /**
     * 会议预订
     *
     * @return
     */
    @PostMapping("/save")
    @ApiOperation("会议订单预订")
    public ResultVO<RowsDataVO<MeetingInqueryPmsListQueryResultDto>> submit(@Valid @RequestBody MeetingBookingInfoDto params) {
        return meetingBookingService.submit(params);
    }


    /**
     * 会场搜索
     *
     * @return
     */
    @PostMapping("/huichang/query")
    @ApiOperation("询价单详情")
    public ResultVO<MeetingInqueryPmsDetailResultDto> huichangQuery(@Valid @RequestBody MeetingInqueryPmsDetailQueryDto params) {
        return meetingBookingService.pmsDetail(params);
    }

    /**
     * 会议列表查询
     *
     * @return
     */
    @PostMapping("/list")
    @ApiOperation("会议订单列表搜索查询")
    public ResultVO<RowsDataVO<MeetingBookingInfoDto>> list(@Valid @RequestBody MeetingBookingInfoQueryDto params) {
        return meetingBookingService.list(params);
    }

    @PostMapping("/meeting/team/list")
    @ApiOperation("团队预订查询已有会议订单列表")
    public ResultVO<RowsDataVO<MeetingTeamListResultDTO>> meetingTeamList(@Valid @RequestBody MeetingTeamListDTO params){
        return meetingBookingService.meetingTeamList(params);
    }

}
